package com.waimai.www.service;

import java.util.ArrayList;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.waimai.www.dao.CaipinMapper;
import com.waimai.www.dao.UsersMapper;
import com.waimai.www.po.Caipin;
import com.waimai.www.po.Users;

@Service
public class UserService {

	@Autowired
	UsersMapper usersmapper;
	@Autowired
	CaipinMapper caipinmapper;

	/// 需要将这个装入相应的vo层（以下仅测试)
	public Users findById(int id) {
		Users user = usersmapper.findUserById(id);
		user.setShopping_cart(usersmapper.findShopping_cartById(id));
		return user;
	}

	public ArrayList<Caipin> findAll() {
		ArrayList<Caipin> al = caipinmapper.findAll();
		return al;
	}

}
